arm: imx: hab: Implement hab_rvt_check_target
authorBryan O'Donoghue <[email protected]>
Fri, 12 Jan 2018 12:40:09 +0000 (12:40 +0000)
committerStefano Babic <[email protected]>
Sun, 14 Jan 2018 16:26:30 +0000 (17:26 +0100)
This patch implements the basic callback hooks for hab_rvt_check_target()
for BootROM code using the older BootROM address layout - in my test case
the i.MX7. Code based on new BootROM callbacks will just have HAB_SUCCESS
as a result code. Adding support for the new BootROM callbacks is a TODO.

Signed-off-by: Bryan O'Donoghue <[email protected]>
Cc: Stefano Babic <[email protected]>
Cc: Fabio Estevam <[email protected]>
Cc: Peng Fan <[email protected]>
Cc: Albert Aribaud <[email protected]>
Cc: Sven Ebenfeld <[email protected]>
Cc: George McCollister <[email protected]>
Cc: Breno Matheus Lima <[email protected]>
Tested-by: Breno Lima <[email protected]>
Reviewed-by: Fabio Estevam <[email protected]>
arch/arm/mach-imx/hab.c

index 364bd6b5c320a67d71d5382c2678947d31ca06ae..2a18ea2da5d1214086b41ee39fcb0e7e9a63a942 100644 (file)
        ((hab_rvt_exit_t *)HAB_RVT_EXIT)                        \
 )
 
+static inline enum hab_status hab_rvt_check_target_new(enum hab_target target,
+                                                      const void *start,
+                                                      size_t bytes)
+{
+       return HAB_SUCCESS;
+}
+
+#define hab_rvt_check_target_p                                 \
+(                                                              \
+       (is_mx6dqp()) ?                                         \
+       ((hab_rvt_check_target_t *)hab_rvt_check_target_new) :  \
+       (is_mx6dq() && (soc_rev() >= CHIP_REV_1_5)) ?           \
+       ((hab_rvt_check_target_t *)hab_rvt_check_target_new) :  \
+       (is_mx6sdl() && (soc_rev() >= CHIP_REV_1_2)) ?          \
+       ((hab_rvt_check_target_t *)hab_rvt_check_target_new) :  \
+       ((hab_rvt_check_target_t *)HAB_RVT_CHECK_TARGET)        \
+)
+
 #define ALIGN_SIZE             0x1000
 #define MX6DQ_PU_IROM_MMU_EN_VAR       0x009024a8
 #define MX6DLS_PU_IROM_MMU_EN_VAR      0x00901dd0